package org.jeecg.modules.golf.question.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.common.exception.JeecgBootException;
import org.jeecg.modules.golf.question.entity.QuestionType;

import java.util.List;
import java.util.Map;

/**
 * @Description: 问题分类
 * @Author: jeecg-boot
 * @Date:   2020-11-10
 * @Version: V1.0
 */
public interface IQuestionTypeService extends IService<QuestionType> {

	/**根节点父ID的值*/
	public static final String ROOT_PID_VALUE = "0";

	/**树节点有子节点状态值*/
	public static final String HASCHILD = "1";

	/**树节点无子节点状态值*/
	public static final String NOCHILD = "0";

	/**新增节点*/
	void addQuestionType(QuestionType questionType);

	/**修改节点*/
	void updateQuestionType(QuestionType questionType) throws JeecgBootException;

	/**删除节点*/
	void deleteQuestionType(String id) throws JeecgBootException;

	/**查询所有数据，无分页*/
    List<QuestionType> queryTreeListNoPage(QueryWrapper<QuestionType> queryWrapper);

	/**
	 * 根据用户id查询所有类型及总数 前五
	 * @param userid
	 * @return
	 */
	List<Map<String, String>> queryTypeByUserId(String userid);
}
